/**
 * Copyright 2011 Joe Choi, All rights reserved.
 */
package tao.data.structure.tree;

/**
 * To build a tree by reference the structure and content of given tree
 * 
 * @author Joe Choi
 */
public interface Builder<V, T extends Tree<V>> {
	/**
	 * To build a new tree
	 */
	public Builder<V, T> build();
	
	/**
	 * Get the built Tree
	 */
	public T getTarget();
	
	/**
	 * To handle the event of traversing a tree, through it, an new tree can be built
	 */
	public interface Handler<S, V, T extends Tree<V>> extends Traversal.Listener<S> {
		public void setSource(Tree<S> source);

		public Traversal<S> getTraversal();
		public T getRoot();
	}
	
}
